//
//  HealthKitManager.h
//  RNWalkCounter
//
//  Created by GJS on 2021/3/9.
//  Copyright © 2021 Facebook. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <HealthKit/HealthKit.h>
#import <CoreMotion/CoreMotion.h>

NS_ASSUME_NONNULL_BEGIN

@interface HealthKitManager : NSObject

+ (id)shareInstance;

// 应用授权检查
- (void)authorizeHealthKit:(void(^)(BOOL success, NSError *error))compltion;
// 获取步数
- (void)getStepCount:(void (^)(double value, NSError *error))completion;
// 获取公里数
- (void)getDistance:(void(^)(double value, NSError *error))completion;
//长时间监听步数变化
- (void)observeStepCountChanged:(void(^)(HKObserverQuery *query, HKObserverQueryCompletionHandler completionHandler, NSError * _Nullable error))updateHandler;
//长时间监听数据变化
- (void)observeHealthChanged:(HKSampleType *)sampleType
               updateHandler:(void(^)(HKObserverQuery *query, HKObserverQueryCompletionHandler completionHandler, NSError * _Nullable error))updateHandler;

@end

NS_ASSUME_NONNULL_END
